import org.xbill.DNS.*;
import org.xbill.DNS.Record;


public class DnsTestClient {
    public static void main(String[] args) throws Exception {
        Resolver resolver = new SimpleResolver("172.40.1.1");
        Lookup lookup = new Lookup("test.local", Type.A);
        lookup.setResolver(resolver);
        Record[] records = lookup.run();

        if (records == null) {
            System.out.println("❌ 查询失败：" + lookup.getErrorString());
        } else {
            for (Record r : records) {
                System.out.println("✅ 得到记录: " + r);
            }
        }
    }
}
